﻿namespace WinQuickIP
{
    public class IPRepresentation
    {
        public uint Adapter { get; set; }
        public bool DHCP { get; set; }
        public string IP { get; set; }
        public string Netmask { get; set; }
        public string Gateway { get; set; }
        public string DNS1 { get; set; }
        public string DNS2 { get; set; }

        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            IPRepresentation o = obj as IPRepresentation;
            if (o == null) return false;
            return o.GetHashCode() == GetHashCode();
        }

        public override int GetHashCode()
        {
            string hashCode = "" +  DHCP + IP + Netmask + Gateway + DNS1 + DNS2;
            return hashCode.GetHashCode();
        }

        public override string ToString()
        {
            return IP;
        }
    }
}
